home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 June / CHIP Haziran 2001.iso / prog / haziran / 19 / setup.exe / data.z / spkr_gui.frm < prev    next >
Text File  |  2001-04-11  |  4KB  |  137 lines

  1. VERSION 5.00
  2. Begin VB.Form spkr_gui 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    Caption         =   "Speaker"
  5.    ClientHeight    =   1800
  6.    ClientLeft      =   4410
  7.    ClientTop       =   4485
  8.    ClientWidth     =   5250
  9.    Icon            =   "spkr_gui.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   1800
  14.    ScaleWidth      =   5250
  15.    ShowInTaskbar   =   0   'False
  16.    Begin VB.CommandButton Exit_Button 
  17.       Caption         =   "Exit"
  18.       Height          =   375
  19.       Left            =   3840
  20.       TabIndex        =   7
  21.       Top             =   1200
  22.       Width           =   1095
  23.    End
  24.    Begin VB.CommandButton About_Button 
  25.       Caption         =   "About"
  26.       Height          =   375
  27.       Left            =   2040
  28.       TabIndex        =   6
  29.       Top             =   1200
  30.       Width           =   1095
  31.    End
  32.    Begin VB.TextBox duration 
  33.       Height          =   285
  34.       Left            =   3840
  35.       TabIndex        =   5
  36.       Text            =   "1000"
  37.       Top             =   600
  38.       Width           =   1095
  39.    End
  40.    Begin VB.TextBox frequency 
  41.       Height          =   285
  42.       Left            =   3840
  43.       TabIndex        =   4
  44.       Text            =   "440"
  45.       Top             =   120
  46.       Width           =   1095
  47.    End
  48.    Begin VB.CommandButton Tone_Button 
  49.       Caption         =   "Play Tone"
  50.       Height          =   375
  51.       Left            =   240
  52.       TabIndex        =   1
  53.       Top             =   360
  54.       Width           =   1095
  55.    End
  56.    Begin VB.CommandButton ChimeButton 
  57.       Caption         =   "Play Chime"
  58.       Height          =   375
  59.       Left            =   240
  60.       TabIndex        =   0
  61.       Top             =   1200
  62.       Width           =   1095
  63.    End
  64.    Begin VB.Label Label2 
  65.       Caption         =   "Duration (milliseconds)"
  66.       Height          =   255
  67.       Left            =   1800
  68.       TabIndex        =   3
  69.       Top             =   600
  70.       Width           =   1815
  71.    End
  72.    Begin VB.Label Label1 
  73.       Caption         =   "Frequency (Hertz)"
  74.       Height          =   255
  75.       Left            =   1800
  76.       TabIndex        =   2
  77.       Top             =   120
  78.       Width           =   1575
  79.    End
  80.    Begin VB.Line Line1 
  81.       X1              =   0
  82.       X2              =   5280
  83.       Y1              =   960
  84.       Y2              =   960
  85.    End
  86. End
  87. Attribute VB_Name = "spkr_gui"
  88. Attribute VB_GlobalNameSpace = False
  89. Attribute VB_Creatable = False
  90. Attribute VB_PredeclaredId = True
  91. Attribute VB_Exposed = False
  92. '////////////////////////////////////////////////////////////////
  93. '// File - spktGUI.frm - code
  94. '//
  95. '// This application plays a tone to the speaker, and is
  96. '// controlled via a graphical user interface
  97. '// The speaker is accessed directly on the motherboard, using
  98. '// WinDriver functions.
  99. '//
  100. '////////////////////////////////////////////////////////////////
  101.  
  102.  
  103. Dim hSPEAKER As SPEAKER_HANDLE
  104. ' show an about box
  105. Private Sub About_Button_Click()
  106.     MsgBox "Speaker Sample v1.0" & Chr$(13) & Chr$(13) & _
  107.     "This sample accesses the on-board speaker" & Chr$(13) _
  108.     & " through the WinDriver's Visual Basic interface." _
  109.     & Chr$(13) & Chr$(13) & "Copyright (c) 2001 Jungo" _
  110.            , vbOKOnly, "About the Speaker Sample "
  111. End Sub
  112. ' play a simple chime
  113. Private Sub ChimeButton_Click()
  114.     SPEAKER_Tone hSPEAKER, 440, 400
  115.     SPEAKER_Tone hSPEAKER, 329, 200
  116.     SPEAKER_Tone hSPEAKER, 1, 10
  117.     SPEAKER_Tone hSPEAKER, 329, 200
  118.     SPEAKER_Tone hSPEAKER, 369, 400
  119.     SPEAKER_Tone hSPEAKER, 329, 800
  120.     SPEAKER_Tone hSPEAKER, 415, 400
  121.     SPEAKER_Tone hSPEAKER, 440, 600
  122. End Sub
  123. Private Sub Exit_Button_Click()
  124.     SPEAKER_Close hSPEAKER
  125.     Unload spkr_gui
  126. End Sub
  127. ' initialze and open a handle to the speaker
  128. Private Sub Form_Load()
  129.     If (Not SPEAKER_Open(hSPEAKER)) Then
  130.         MsgBox SPEAKER_ErrorString, vbOKOnly, "ERROR"
  131.     End If
  132. End Sub
  133. ' play one tone
  134. Private Sub Tone_Button_Click()
  135.     SPEAKER_Tone hSPEAKER, spkr_gui.frequency.Text, spkr_gui.duration.Text
  136. End Sub
  137.